<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title id="title">gorgeous-doc</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/layui/nprogress/nprogress.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/global.css}">
    <div th:include="common/common.html"></div>
</head>
<body>
<div class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header header ">
            <div id="header-body">
            </div>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:openSwitch();">切换<!--弹框修改项目分支环境--></a>
                </li>
                <li class="layui-nav-item update-btn">
                    <a href="javascript:updateApi()">更新</a>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:window.open(context+'manage','3');">设置</a>
                </li>
            </ul>
        </div>
        <div id="menu-body">
        </div>
        <div class="layui-body api-body">
            <!-- 内容主体区域 -->
            <div class="layui-tab layui-tab-brief" lay-filter="api-tab" lay-allowClose="true">
                <ul class="layui-tab-title">
                    <li class="layui-this">主页</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div th:include="doc.html"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
<div th:include="menu/switchTemplate.html"></div>
<div th:include="menu/menuTemplate.html"></div>
<div th:include="api/apiTemplate.html"></div>

<script type="text/javascript">
    let projectData;
    let envData;
    let currProject;
    let currProjectData;
    let projectConfigData = [];

    layui.use(modes, function () {
        let load = function () {
            currProject = getCurrProject();
            getEnvAll(data => envData = data);

            projectAll(data => {
                projectData = data;
                //设置当前项目
                setCurrProjectData(currProject);
                //显示菜单
                renderMenu();
                //打开上次的菜单
                let currMenuId = getCurrMenuId(currProject.branchId);
                if (currMenuId) {
                    positionMenu(currMenuId);
                    openTab(currMenuId);
                }
            })
        };
        loadScript(['js/config', 'js/menu/menu', 'js/class/class', 'js/project/project', 'js/env/env', 'js/api/api'], load);
    });

</script>

</html>

